import * as types from "../actions/actionTypes";

const initialState = {
  name: "test",
  path: "",
  age:18
};

function reducer(state = initialState, action) {
  switch (action.type) {
    case types.SET_TEST_NAME:
      return { ...state, ...{ name: action.name } };
    case types.INCREMENT:
      return { ...state,age:state.age+parseInt(action.payload)};
    default:
      return state;
  }
}

export default reducer;
